<template>
  <div @click="handleClick">
    <van-card
      :num="item.mum"
      :price="item.price"
      :desc="item.desc"
      :title="item.title"
      :thumb="item.thumb"
      class="card"
    />
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const props = defineProps({
  item: {
    type: Object,
    required: true
  }
})
const handleClick = () => {
  router.push(`/item/${props.item.id}`) // 确保item数据中有id字段
}

</script>

<style scoped>
.card {
--van-card-price-font-size: 0px;
--van-card-title-line-height: 30px;
--van-card-price-integer-font-size: 12px;
}
</style>